var bnrObj1 = [
	//set1 -------------------------------------------------
	{
		'src' : '/images/index_bn19.jpg',
		'param' : '',
		'type': 'image',
		'alt' : 'ダブル発電家族の住まい',
		'height' : '90',
		'URL' : '/double-sp/index.html',
		'icon': '',  //なし or nomalLink01 or blankLink
		'target' : '_blank',
		'cap' : ''
	},
	//set2 -------------------------------------------------
	{
		'src' : '/images/index_bn15.gif',
		'param' : '',
		'type': 'image',
		'alt' : 'ENEOSみんなの創エネ',
		'height' : '50',
		'URL' : '/minnanosouene/',
		'icon': 'blankLink', //なし or nomalLink01 or blankLink
		'target' : '_blank',
		'cap' : 'ENEOS わが家で創エネ・プロジェクトのスペシャルサイトです。'
	}
	//最後の “}”の後には “,（カンマ）” を付けない
];


function rndBanner(topbannerObj){
	
	bnSource= new Array();
	var classIC = "";
	for(i=0;i<topbannerObj.length;i++){
		classIC = ' class="'+topbannerObj[i].icon+'"';
		if(topbannerObj[i].type == 'image'){
			if(!topbannerObj[i].param){
				topbannerObj[i].param = "";
			}
			bnSource[i] = '<a href="'+topbannerObj[i].URL+''+topbannerObj[i].param+'" target="'+topbannerObj[i].target+'"><img src="'+topbannerObj[i].src+'" alt="'+topbannerObj[i].alt+'" width="208" height="'+topbannerObj[i].height+'" /></a>';
			if(topbannerObj[i].cap !=''){
				bnSource[i] = '<dl><dt>' + bnSource[i] + '</dt><dd'+classIC+'><a href="'+topbannerObj[i].URL+''+topbannerObj[i].param+'" target="'+topbannerObj[i].target+'">' + topbannerObj[i].cap+'</a></dd></dl>';
			}
		}else if(topbannerObj[i].type == 'flash'){
			bnSource[i] = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="208" height="'+topbannerObj[i].height+'"><param name="movie" value="'+topbannerObj[i].src+'"><param name="quality" value="high"><embed src="'+topbannerObj[i].src+'"  quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="208" height="'+topbannerObj[i].height+'"></embed></object>'
			if(topbannerObj[i].cap !=''){
				bnSource[i] = '<dl><dt>' + bnSource[i] + '</dt><dd'+classIC+'><a href="'+topbannerObj[i].URL+''+topbannerObj[i].param+'" target="'+topbannerObj[i].target+'">' + topbannerObj[i].cap+'</a></dd></dl>';
			}
		}
	}
	
	n = Math.floor(Math.random()*bnSource.length);
	document.write(bnSource[n]);
}